/*
 * @Description:购买道具
 * @Author: iamsmiling
 * @Date: 2021-06-13 11:33:33
 * @LastEditTime: 2021-06-13 12:19:45
 */
import 'package:credit_business_circle/R/R.dart';
import 'package:credit_business_circle/pages/mine/children/prop_kit/children/buy_propkit/buy_propkit_controller.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class BuyPropkitPage extends GetView<BuyPropkitController> {
  const BuyPropkitPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("购买${controller.card.label}"),
        elevation: .5,
      ),
      body: GetBuilder<BuyPropkitController>(builder: (_) {
        return SingleChildScrollView(
          child: Column(
            children: [
              Container(
                margin: EdgeInsets.only(bottom: R.dimen.dp10),
                width: R.dimen.width,
                color: R.color.ffffffff,
                child: Column(
                  children: [
                    Container(
                        margin: EdgeInsets.only(
                            top: R.dimen.dp38, bottom: R.dimen.dp34),
                        child: Image.asset(_.card.bigIcon)),
                    Text(
                      _.card.label,
                      style: TextStyle(
                          fontSize: R.dimen.sp15,
                          color: R.color.ff111111,
                          fontWeight: FontWeight.w600),
                    ),
                    Container(
                      margin: EdgeInsets.only(
                          top: R.dimen.dp18, bottom: R.dimen.dp35),
                      child: Text(
                        _.card.description,
                        style: TextStyle(
                            fontSize: R.dimen.sp13, color: R.color.ff999999),
                      ),
                    )
                  ],
                ),
              ),
              Container(
                color: R.color.ffffffff,
                padding: EdgeInsets.symmetric(vertical: R.dimen.dp24),
                child: Column(
                  children: [
                    for (int i in [1, 2, 3, 4, 5, 6, 7])
                      Container(
                        padding: EdgeInsets.symmetric(
                            horizontal: R.dimen.dp18, vertical: R.dimen.dp16),
                        child: Row(
                          children: [
                            Image.asset(_.card.icon),
                            Container(
                              margin: EdgeInsets.only(
                                  left: R.dimen.dp10, right: R.dimen.dp35),
                              child: Column(
                                children: [
                                  Text(
                                    _.card.label,
                                    style: TextStyle(
                                        fontSize: R.dimen.sp17,
                                        color: R.color.ff111111,
                                        fontWeight: FontWeight.w600),
                                  ),
                                  Text(
                                    "X$i",
                                    style: TextStyle(
                                        height: 1.5,
                                        fontSize: R.dimen.sp10,
                                        color: R.color.ff666666),
                                  ),
                                ],
                              ),
                            ),
                            Text(
                              "¥${_.card.price}",
                              style: TextStyle(
                                  fontSize: R.dimen.sp17,
                                  color: R.color.fff35044),
                            ),
                            Container(
                              margin: EdgeInsets.only(
                                  left: R.dimen.dp15, right: R.dimen.dp10),
                              child: Text(
                                " ¥ 99",
                                style: TextStyle(
                                    fontSize: R.dimen.sp13,
                                    color: R.color.ff999999,
                                    decoration: TextDecoration.lineThrough),
                              ),
                            ),
                            Container(
                              child: Text(
                                "8折",
                                style: TextStyle(
                                    fontSize: R.dimen.sp12,
                                    color: R.color.ff999999),
                              ),
                            ),
                            Spacer(),
                            Container(
                              padding: EdgeInsets.symmetric(
                                  horizontal: R.dimen.dp20,
                                  vertical: R.dimen.dp7),
                              decoration: BoxDecoration(
                                  borderRadius:
                                      BorderRadius.circular(R.dimen.sp20),
                                  gradient: LinearGradient(colors: [
                                    R.color.ff1fc896,
                                    R.color.ff2eab86
                                  ])),
                              child: Text(
                                "购买",
                                style: TextStyle(
                                    fontSize: R.dimen.sp13,
                                    color: R.color.ffffffff),
                              ),
                            ),
                          ],
                        ),
                      )
                  ],
                ),
              )
            ],
          ),
        );
      }),
    );
  }
}
